From e61c814cd6092530474bebda3c66133146525ba5 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Mon, 27 Nov 2006 10:14:45 +0000 Subject: [PATCH] [HVM] Fix bugs in RTC alarm code. - comparing bcd with binary data - comparing min with mon Signed-off-by: Xiaowei Yang --- xen/arch/x86/hvm/rtc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c index ea7f0ce9df..1f26dc9252 100644 --- a/xen/arch/x86/hvm/rtc.c +++ b/xen/arch/x86/hvm/rtc.c @@ -282,11 +282,14 @@ static void rtc_update_second2(void *opaque) if ( s->cmos_data[RTC_REG_B] & RTC_AIE ) { if ( ((s->cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0 || - s->cmos_data[RTC_SECONDS_ALARM] == s->current_tm.tm_sec) && + from_bcd(s, s->cmos_data[RTC_SECONDS_ALARM]) == + s->current_tm.tm_sec) && ((s->cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0 || - s->cmos_data[RTC_MINUTES_ALARM] == s->current_tm.tm_mon) && + from_bcd(s, s->cmos_data[RTC_MINUTES_ALARM]) == + s->current_tm.tm_min) && ((s->cmos_data[RTC_HOURS_ALARM] & 0xc0) == 0xc0 || - s->cmos_data[RTC_HOURS_ALARM] == s->current_tm.tm_hour) ) + from_bcd(s, s->cmos_data[RTC_HOURS_ALARM]) == + s->current_tm.tm_hour) ) { s->cmos_data[RTC_REG_C] |= 0xa0; hvm_isa_irq_deassert(s->vcpu->domain, s->irq); -- 2.30.2